<template>
  <div class="main-wrapper account-wrapper" style="background-color: whitesmoke;width:100% ;height: 100%;position : absolute">
    <div class="account-page">
      <div class="account-center">
        <div class="account-box">

            <div class="account-logo">
              <img src="../../assets/img/logo-dark.png" alt="">
            </div>
            <div class="form-group">
              <label style="float: left;">账 号</label>
              <input type="text" autofocus="" class="form-control" v-model="Login.account">
            </div>
            <div class="form-group">
              <label style="float: left">密 码</label>
              <input type="password" class="form-control" v-model="Login.password">
            </div>
            <div class="form-group text-right">
              <a href="forgot-password.html">忘记密码</a>
            </div>
            <div class="form-group text-center">
              <button class="btn btn-primary account-btn" @click="handleLogin">登录</button>
            </div>
            <div class="text-center register-link">
              学生登录？<router-link to="/" style="color:deepskyblue;">学生登录</router-link>
            </div>
        </div>
      </div>
    </div>
  </div>
</template>



<script>
import axios from "axios";

export default {
  name: "TeacherLoginForm",
  methods:{
    handleLogin(){
      axios.post('api/teacher/login',this.Login).then(res=>{
        sessionStorage.setItem('User',JSON.stringify(res.data.data))
        this.$router.push('/Teacher/PublishHomework')
      }).catch(error=>{
        console.log(error);
      })
    }
  },
  data(){
    return{
      Login:{account:undefined,password:undefined}
    }
  }
}
</script>

<style scoped src="../../assets/css/bootstrap.min.css"></style>
<style scoped src="../../assets/css/font-awesome.min.css"></style>
<style scoped src="../../assets/css/style.css"></style>
<style scoped>

</style>